<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title信息管理平台 - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="root/css/bootstrap.min.css" rel="stylesheet">
    <link href="root/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="root/css/animate.css" rel="stylesheet">
    <link href="root/css/style.css" rel="stylesheet">
    <link href="root/css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>
    <style>
        .yzm{

        }
        .yzm input{
            display: inline-block !important;
            width: 100px;
            margin-right: 9px;
            margin-top: 0 !important;
            color: #333333;
        }
        .yzm img{
            vertical-align: middle;
            margin-top: -3px;
        }
    </style>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[信息管理平台]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>后台管理系统</strong></h4>
                </div>
            </div>
            <div class="col-sm-5">
                <form method="post" id="form">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到后台系统</p>
                    <input type="text" class="form-control uname" required name="username" placeholder="用户名" />
                    <input type="password" class="form-control pword m-b" required name="password" placeholder="密码" />
                    <!--<a href="">忘记密码了？</a>-->
                    <button class="btn btn-success btn-block" id="sub">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                <!--&copy; 2015 All Rights Reserved.-->
            </div>
        </div>
    </div>
</body>
<script src="root/js/jquery.min.js?v=2.1.4"></script>
<script src="root/js/plugins/layer/layer.min.js"></script>
<script>

    $(function () {
        $('#form').submit(function () {
            var data = $(this).serialize();
            $.ajax({
                url:'{:url("login/ajax_login")}',
                type:"post",
                data:data,
                dataType:'json',
                success:function (res) {
                    layer.msg(res.msg);
                    if(res.code==1){
                        setTimeout(function () {
                            window.location.href="{:url('index/index')}";
                        },2000)
                    }
                }
            })
            return false;
        })
    })
</script>
</html>
